package com.example.book_system.dao;

import com.example.book_system.model.BookInfo;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@Repository
public class BookDao {
    public List<BookInfo> mockData() {
        List<BookInfo> books = new ArrayList<>();
        for(int i = 0; i < 5; i++){
            BookInfo book = new BookInfo();
            book.setId(i + 1);
            book.setBookName("武功秘籍"+(i+1));
            book.setAuthor("作者"+i);
            book.setCount((int)(Math.random()*1000));
            book.setPrice(new BigDecimal((int)(Math.random()*1000)));
            book.setPublish("出版社"+ (i + 1));
            book.setStatus(1);
            books.add(book);
        }
        return books;
    }
}
